import dataAnalysis.data.utils.DButil as db
cursor = db.connection.cursor()

def save_type(item):
    keys = item.keys()
    values = tuple(item.values())
    fields = ",".join(keys)
    temp = ",".join(["%s"] * len(keys))
    sql = "INSERT INTO sys_category (%s) VALUES (%s)" % (fields, temp)
    cursor.execute(sql, values)
    return db.connection.commit()
def save_movie(item):
    keys = item.keys()
    values = tuple(item.values())
    fields = ",".join(keys)
    temp = ",".join(["%s"] * len(keys))
    sql = "INSERT INTO sys_movie (%s) VALUES (%s)" % (fields, temp)
    cursor.execute(sql, values)
    return db.connection.commit()